#ifndef SECURETESTWINDOW_H
#define SECURETESTWINDOW_H

#include <QtNetwork/QTcpSocket>
#include "lib/GCrypt/include/GCrypt.h"
#include "InnerWindow.h"
#include "ui_SecureTestForm.h"

class SecureTestWindow: public InnerWindow, Ui::Form
{
    Q_OBJECT

private:
    QTcpSocket* pTcpSocket;
    GCrypt crypt;
    QString msg;
    QString baseEnc;
    QString plainEnc;
public:
    SecureTestWindow();
    ~SecureTestWindow();

    void clearInnerWindow();

    int Encrypt(std::string in, std::string &out);
    int Decrypt(std::string in, std::string &out);

private slots:
    void connected();
    void disconnected();
    void readyToRead();
    void error(QAbstractSocket::SocketError err);
    void sendToServer();

    void clickedResponseBase();
    void clickedResponseHex();
    void clickedResponsePlain();

    void clickedQueryBase();
    void clickedQueryHex();
    void clickedQueryPlain();

    void clickedKeyBase();
    void clickedKeyHex();
    void clickedKeyPlain();

    void dwnPressed();
};

#endif // SECURETESTWINDOW_H
